#!/bin/bash

name=$1
URL=$2

if [[ -f $name/$name.framework ]]; then
    echo "$name/$name.framework Exist"
    exit 0
fi

if [[ ! -d framework_download_dir ]]; then
    mkdir framework_download_dir
fi
cd framework_download_dir

RET=$(curl --fail -O -v $URL)
if [[ -f $name.zip && ! $RET ]]; then
    unzip $name.zip
    cp -R $name.framework ../
fi

cd ..
rm -rf framework_download_dir

